<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path = request.getContextPath(); request.setCharacterEncoding("UTF-8");
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>">
    <title>燃气险保险查询</title>
    <jsp:include page="/WEB-INF/jsp/common/common.jsp"></jsp:include>
    <link href="css/calendar.css"  rel="stylesheet" type="text/css" >
    <link rel="stylesheet" href="<%=path%>/css/zTreeStyle/zTreeStyle.css">
    <script type="text/javascript" src="<%=path%>/js/jquery.ztree.core-3.5.js"></script>
    <script type="text/javascript" src="<%=path%>/js/jquery.ztree.excheck-3.5.js"></script>
    <script src="<%=path%>/js/jquery.divbox.js" type="text/javascript"></script>
    <style type="text/css">
        .sub-title {
            background: none repeat scroll 0 0 #ffffff;
            font-size: 100%;
            font-weight: bold;
            height: 30px;
            line-height: 30px;
            text-indent: 10px;
            width: 100%;
        }
    </style>
    <script language="javascript" type="text/javascript">

        var defaultBranch;//保存默认机构的值

        $(document).ready(function() {
            isReadyIframe();

            loadPrivilegeBranchSelect();//加载机构下拉框

            defaultDate();
        });

        function isReadyIframe(){
            var iframe = $(window.parent.document).find("#iframe").length;
            if(iframe==0){
                window.location.href="<%=basePath%>index.jsp";
            }
        }

        //加载机构下拉框
        function loadPrivilegeBranchSelect(){
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryPrivilegeBranch?"+new Date().getTime(),
                type : 'POST',
                async : false,
                dataType:'json',
                success : function(result) {
                    if(result){
                        if($.validate(result))return;

                        //接口下拉框对象
                        var privilegeBranchSelect = document.getElementById("privilegeBranch");
                        privilegeBranchSelect.length=0;

                        var data = result.data;
                        if(data.length > 0){
                            defaultBranch = data[0].deptCode;

                            for (var i = 0; i < data.length; i++) {
                                var option = new Option();
                                option.text = data[i].deptCname;
                                option.title = data[i].deptCname;
                                option.value = data[i].deptCode;

                                privilegeBranchSelect.add(option);
                            }
                        }
                    }
                }
            });
        }

        //所选机构改变时，清空相关联数据
        function clearBranchRelaField(){
            $("#dptCode").val("");
            $("#partnerNo").val("");
            $("#subPartnerNo").val("");
        }

        //------------------------------------------ 出单机构 开始----------------------------------------------
        //打开出单机构窗口
        function openDeptDiv(pageIndex,obj){

            if($.trim($('#privilegeBranch').val()).length == 0){
                $.message("error", "请先选择机构");
                return;
            }

            $('#deptCode').val('');
            $('#deptCname').val('');
            $("#"+obj.id).blur();
            queryCoreDept(pageIndex);
        }

        //查询出单机构
        function queryCoreDept(pageIndex){
            var size = 8;
            var deptCode = $.trim($('#deptCode').val());
            var deptCname = $.trim($('#deptCname').val());
            var parentDeptCode =  $.trim($('#privilegeBranch').val());

            $.openLoading();
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryDeptByDeptAndParentDeptCode",
                type : 'POST',
                async : true,
                data:{
                    size:size,
                    pageIndex:pageIndex,
                    deptCode:deptCode,
                    deptCname:deptCname,
                    parentDeptCode:parentDeptCode
                },
                dataType:'json',
                success:function(page){
                    $.closeLoading();
                    if($.validate(page))return;

                    var radioObj ="<input class='input_fxk' name='deptradio' type='radio' value=''>";
                    var fieldNames = "deptCode,deptCNname";
                    var tableContent = creatTable1(fieldNames,page,radioObj);
                    var tableObj = $("#deptTable");
                    tableObj.find("tbody").remove();
                    tableObj.append(tableContent);

                    var strPage = creatChannelPage3(pageIndex,6,page.maxPage,"18");
                    var pageDIV = $("#deptPageDIV");
                    pageDIV[0].innerHTML="";
                    pageDIV.append(strPage);

                    $("#deptDiv").OpenDiv();

                    bindradio();
                }
            });
        }

        //点击“确定” ，选择 出单机构
        function chooseDept(){
            var selectedDept= $("input[name='deptradio']:checked");
            if(selectedDept.length==0){
                $.message("error", "请选择一个出单机构");
                return;
            }
            var deptCode = selectedDept.parent().parent().children(" td:eq(1)").html();
            $('#dptCode').val(deptCode);

            closeCurrentDIV('deptDiv');
        }

        //------------------------------------------ 出单机构 结束----------------------------------------------

        //------------------------------------------ 合作伙伴 开始----------------------------------------------
        //打开合作伙伴 窗口
        function openChannelInfoDiv(pageIndex,obj){
            if(($.trim($('#privilegeBranch').val())).length==0){
                $.message('error',"请先选择机构");
                return;
            }
            $('#channelCode').val('');
            $('#channelName').val('');
            $("#"+obj.id).blur();
            queryTradPartners(pageIndex);
        }

        //查询 合作伙伴
        function queryTradPartners(pageIndex){
            var size = 8;
            var parentDeptCode = $.trim($('#privilegeBranch').val());
            var channelCode = $.trim($('#channelCode').val());
            var channelName = $.trim($('#channelName').val());

            $.openLoading();
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryChannelInfoOfLife",
                type : 'POST',
                async : true,
                data:{
                    pageIndex:pageIndex,
                    size:size,
                    parentDeptCode:parentDeptCode,
                    channelCode:channelCode,
                    channelName:channelName
                },
                dataType:'json',
                success:function(page){
                    $.closeLoading();
                    if($.validate(page))return;

                    var radioObj ="<input class='input_fxk' name='partnerradio' type='radio' value=''>";
                    var fieldNames = "channelCode,channelName";
                    var tableContent = creatTable1(fieldNames,page,radioObj);
                    var tableObj = $("#channelInfoTable");
                    tableObj.find("tbody").remove();
                    tableObj.append(tableContent);

                    var strPage = creatChannelPage2(pageIndex,6,page.maxPage,"16");
                    var pageDIV = $("#channelInfoPageDIV");
                    pageDIV[0].innerHTML="";
                    pageDIV.append(strPage);

                    $('#channelInfoDiv').OpenDiv();

                    bindradio();
                }
            });
        }

        //点击“确定”按钮，选择合作伙伴
        function choosePartner(){
            var selectedPartner = $("input[name='partnerradio']:checked");
            if(selectedPartner.length==0){
                $.message("error", "请选择一个合作伙伴");
                return;
            }
            var selectedPartnerNo = selectedPartner.parent().parent().children(" td:eq(1)").html();
            $('#partnerNo').val(selectedPartnerNo);
            $("#subPartnerNo").val("");

            closeCurrentDIV('channelInfoDiv');
        }

        //------------------------------------------ 合作伙伴 结束----------------------------------------------

        //------------------------------------------ 合作伙伴子机构 开始----------------------------------------------
        //加载subChannelTree
        function openSubChannelTreeDiv(){
            var partnerNo = $.trim($('#partnerNo').val());
            if(partnerNo.length==0){
                $.message("error", "请先选择合作伙伴");
                return;
            }

            $.openLoading();
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/querySubChannelTree?"+new Date().getTime(),
                type : 'POST',
                async : true,
                data:{
                    parentChannelCode:partnerNo
                },
                dataType:'json',
                success:function(data){
                    $.closeLoading();
                    if($.validate(data))return;

                    if(data.length == 0){
                        $.message("error", "所选合作伙伴下没有合作伙伴子机构");return;
                    }
                    var setting = {
                        check: {
                            enable: true,
                            chkStyle: "radio",
                            radioType: "all"
                        },
                        data: {
                            simpleData: {
                                enable: true
                            }
                        }
                    };

                    $.fn.zTree.init($("#subChannelTree"), setting, data);

                    $("#subChannelTreeDiv").OpenDiv();
                }
            });
        }

        //点击“确定”按钮，选择合作伙伴子机构
        function chooseSubPartner(){
            var subChannelTree = $.fn.zTree.getZTreeObj("subChannelTree");
            if(subChannelTree.getCheckedNodes(true).length==0){
                $.message("error", "请选择一个合作伙伴子机构");
                return;
            }
            var subChannels = subChannelTree.getCheckedNodes(true);
            $("#subPartnerNo").val(subChannels[0].id);

            closeCurrentDIV('subChannelTreeDiv');
        }

        //------------------------------------------ 合作伙伴子机构 结束----------------------------------------------


        //“重置”查询条件
        function  resetCriteria(){
            $('#downloadlifePolicyFileForm input[type!="button"]').val("");
            $('#downloadlifePolicyFileForm select[name!="privilegeBranch"]').val("");
            $("#privilegeBranch").val(defaultBranch);//机构置为默认机构
        }
        function bindredio(){
            $("input[name='radioTradProdType']").click(function(){
                $("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
                $(this).parent().parent().addClass("table_highlighter");

            });
        }

        // 校验查询条件
        function checkConditions() {
            var privilegeBranch = $.trim($("#privilegeBranch").val());//机构
            var dptCode = $.trim($("#dptCode").val());//出单机构
            var tradProdType = $.trim($("#tradProdType").val());//产品类型
            var partnerNo = $.trim($("#partnerNo").val());//合作伙伴
            var subPartnerNo= $.trim($("#subPartnerNo").val());//合作伙伴子机构
            var orderId= $.trim($("#orderId").val());//订单号
            var polSubDateBegin=  $.trim($("#polSubDateBegin").val());//保单提交日期
            var polSubDateEnd=  $.trim($("#polSubDateEnd").val());
            var polBeginDateBegin=  $.trim($("#polBeginDateBegin").val());//保单生效日期
            var polBeginDateEnd=  $.trim($("#polBeginDateEnd").val());
            var polno =$.trim($("#polno").val());//保单号
            var polStatus =$.trim($("#polStatus").val());//保单状态
            var tbrName =$.trim($("#tbrName").val());//投保人名称
            var tbrId =$.trim($("#tbrId").val());//投保人证件号
            var bbrName =$.trim($("#bbrName").val());//被保人名称
            var jsonDate = {
                privilegeBranch:privilegeBranch,
                dptCde:dptCode,
                tradProdType:tradProdType,
                partnerNo:partnerNo,
                partnerSubCode:subPartnerNo,
                orderId:orderId,
                polSubDateBegin:polSubDateBegin,
                polSubDateEnd:polSubDateEnd,
                polBeginDateBegin:polBeginDateBegin,
                polBeginDateEnd:polBeginDateEnd,
                polno:polno,
                stateId:polStatus,
                tbrName:tbrName,
                tbrId:tbrId,
                bbrName:bbrName
            }

            // 综合控制  如果没录被保人证件号  带素引的条件必录一个
            if (!dptCode && !partnerNo && !polno) {
                // 日期区间为提交日期一年之内或者生效日期一年之内
                var subBeginDate = (polSubDateBegin&&polSubDateEnd)?dateAddYear(polSubDateBegin, 0):-1
                var subEndDate = (polSubDateBegin&&polSubDateEnd)?dateAddYear(polSubDateEnd, 1):0
                var polBeginDate =  (polBeginDateBegin&&polBeginDateEnd)?dateAddYear(polBeginDateBegin, 0):-1
                var polEndDate =  (polBeginDateBegin&&polBeginDateEnd)?dateAddYear(polBeginDateEnd, 1):0

                if ((subBeginDate - subEndDate < 0) && (polBeginDate - polEndDate < 0)) {
                    $.message('error', '请选择近一年的日期区间或者出单机构、合作伙伴、保单号必录一项！')
                    return false
                }
            }

            return jsonDate
        }
        //点击“查询”
        function queryNocarPolicy(pageIndex){
            var downloadFlag = false;
            if(pageIndex == null){
                pageIndex = 1;
            }
            if(pageIndex == -1){
                pageIndex = 1;
                downloadFlag = true;
            }

            var asyncFlag = true;
            if(pageIndex == -1){
                asyncFlag = false;
            }

            if (checkConditions()) {
                var jsonDate = checkConditions()
            } else {
                return false
            }
            jsonDate.pageIndex = pageIndex
            summaryHide();
            $.openLoading();
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryFuelGasPolicyListPageByCriteria",
                type : 'POST',
                async : asyncFlag,
                dataType:'json',
                data:jsonDate,
                success:function(page){
                    $.closeLoading();
                    if($.validate(page))return;
                    if(page.result == 'noChannelInfo'){
                        //清空表格数据
                        $("#fuelGasPolicyTable").find("tbody").remove();
                        $("#fuelGasPolicyPageDiv").html("");
                        $("#countValidPolicy").text("0");
                        $("#totalPremium").text("0");

                        if(downloadFlag){
                            $.message("error", "导出数据为空");
                        }
                        return;
                    }

                    //业务处理
                    var firstbutton ="<input class='input_fxk' name='radioTradProdType' type='radio' value='#'>";
                    var fieldNames = "polno,dptCde,partnerName,partnerSubName,insuPlanName,policyHolder,userNo,referrerCode,referrer,premium,insertTimeStr,beginDateStr,endDateStr,stateId?[{'2':'承保'};{'3':'已注销'}],spical1,orderNo,tradProdType@TDH";

                    // 不在SQL中出现HTML和JS标签
                    $.each(page.data ,function (i, v) {
                        v.polno = '<a href="javascript:void(0);" ondblclick="polNoDetailInfoHref(this)">' + v.polno + '</a>'
                    })
                    var tableContent = creatTable1(fieldNames,page,firstbutton,null);
                    var tableObj = $("#nocarPolicyTable");
                    tableObj.find("tbody").remove();
                    tableObj.append(tableContent);


                    var strPage = creatChannelPage(pageIndex,6,page.maxPage,"54");
                    var pageDIV = $("#nocarPolicyPageDiv");
                    pageDIV[0].innerHTML="";
                    pageDIV.append(strPage);

                    if(downloadFlag){
                        if(page.data.length == 0){
                            $.message("error", "导出数据为空");
                            return;
                        }

                        $("#downloadlifePolicyFileForm").attr("action","<%=path%>/fuelGasPolicyList/downloadFuelGasPolicyFileByCriteria");
                        $("#downloadlifePolicyFileForm").submit();
                    }
                    bindredio();
                }
            });
        }


        //点击文件下载
        function downloadlifePolicyFile(){
            queryNocarPolicy(-1);
        }

        //弹出层表格绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
        function bindradio(){
            $("input[name='prodradio']").click(function(){
                $("input[name='prodradio']").parent().parent().removeClass("table_highlighter");
                $(this).parent().parent().addClass("table_highlighter");
            });
            $("input[name='partnerradio']").click(function(){
                $("input[name='partnerradio']").parent().parent().removeClass("table_highlighter");
                $(this).parent().parent().addClass("table_highlighter");
            });
            $("input[name='deptradio']").click(function(){
                $("input[name='deptradio']").parent().parent().removeClass("table_highlighter");
                $(this).parent().parent().addClass("table_highlighter");
            });
        }

        //统一 关闭窗口(传入要关闭DIV的id)
        function closeCurrentDIV(obj){
            $("#"+obj).CloseDiv();
        }

        <%-- added by gzz@2015-11-3 for shen zhen you hua begin --%>
        function polNoDetailInfoHref(obj){
            var polNo = $(obj).parent('td').parent('tr')[0].childNodes[1].childNodes[0].innerHTML;
            var tradProdType = $(obj).parent('td').parent('tr')[0].childNodes[13].innerHTML;
            $(obj).parent('td').parent('tr').find("input[name='radioTradProdType']").prop("checked",true);
            $("input[name='radioTradProdType']").parent().parent().removeClass("table_highlighter");
            $(obj).parent('td').parent('tr').addClass("table_highlighter");
            viewDetail_singel(polNo,tradProdType);

        }

        //详细信息查看
        function viewDetail_singel(polNo,tradProdType){
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryViewDetail?+"+new Date().getTime(),
                type : 'POST',
                async:true,
                dataType:'json',
                data:{polNo:polNo,tradProdType:tradProdType},
                success : function(page) {
                    if($.validate(page))return;
                    var data = page.obj;
                    if(data.policy_detail_Info!=null){
                        $('#singel_polno').html(data.policy_detail_Info.polno);
                        $('#singel_beginDate').html(data.policy_detail_Info.beginDateStr);
                        $('#singel_endDate').html(data.policy_detail_Info.endDateStr);
                        $('#singel_premium').html(data.policy_detail_Info.premiumFormatStr);
                        $('#singel_amount').html(data.policy_detail_Info.amountFormatStr);
                        $('#singel_premVat').html(data.policy_detail_Info.premVat);
                        $('#singel_premNotax').html(data.policy_detail_Info.premNotax);
                        $('#singel_planDscp').html(data.policy_detail_Info.insuPlanName);
                        //投保人、被保人
                        $('#singel_realName').html(data.gatewayNocarBase.tbrName);
                        $('#singel_certiType').html(data.gatewayNocarBase.tbrIdTypeName);
                        $('#singel_email').val(data.gatewayNocarBase.tbrEmail);
                        $('#singel_certiCode').html(data.gatewayNocarBase.tbrIdNo);
                        $('#singel_telephone').val(data.gatewayNocarBase.tbrPhone);
                        $('#singel_bbr_realName').html(data.gatewayNocarBase.bbrName);
                        $('#singel_bbr_certiType').html(data.gatewayNocarBase.bbrIdTypeName);
                        $('#singel_bbr_telephone').html(data.gatewayNocarBase.bbrPhone);
                        $('#singel_bbr_certiCode').html(data.gatewayNocarBase.bbrIdNo);

                        if(data.policy_detail_Info.epolicyUrl){
                            $("#singelIsEpolicyl").show();
                            $("#singelEpolicylUrl").attr("href",data.policy_detail_Info.epolicyUrl);
                        }else{
                            $("#singelIsEpolicyl").hide();
                            $("#singelEpolicylUrl").attr("href",data.policy_detail_Info.epolicyUrl);
                        }
                    }
                    $('#policyDetailInfo').OpenDiv();
                }
            });
        }
        /**邮件重发*/
        function reSendEmail(){
            var polNo=$('#singel_polno').html();
            var  email=$('#singel_email').val();
            var reg=/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
            if(!reg.test(email)){
                $.message("error", "邮箱有误！");
                return;
            }
            $.openLoading();

            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/reSendEmail?+"+new Date().getTime(),
                type : 'POST',
                async:true,
                dataType:'json',
                data:{polNo:polNo,email:email},
                success : function(result) {
                    $.closeLoading();
                    $.message(result.result,result.message);
                }
            });
        }
        /**短信重发*/
        function reSendSMS(){

            var polNo=$('#singel_polno').html();
            var  phoneNo=$('#singel_telephone').val();
            var reg=/^[1][3,4,5,7,8][0-9]{9}$/;
            if(!reg.test(phoneNo)){
                $.message("error", "手机号有误！");
                return;
            }
            $.openLoading();

            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/reSendSms?+"+new Date().getTime(),
                type : 'POST',
                async:true,
                dataType:'json',
                data:{polNo:polNo,phoneNo:phoneNo},
                success : function(result) {
                    $.closeLoading();
                    $.message(result.result,result.message);
                }
            });
        }

        //日期格式化
        Date.prototype.format = function(format)
        {
            var o = {
                "M+" : this.getMonth()+1, //month
                "d+" : this.getDate(),    //day
                "h+" : this.getHours(),   //hour
                "m+" : this.getMinutes(), //minute
                "s+" : this.getSeconds(), //second
                "q+" : Math.floor((this.getMonth()+3)/3),  //quarter
                "S" : this.getMilliseconds() //millisecond
            }
            if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
                (this.getFullYear()+"").substr(4 - RegExp.$1.length));
            for(var k in o)if(new RegExp("("+ k +")").test(format))
                format = format.replace(RegExp.$1,
                    RegExp.$1.length==1 ? o[k] :
                        ("00"+ o[k]).substr((""+ o[k]).length));
            return format;
        }

        //信保通需求，默认带出最近一个月的信息
        function defaultDate(){
            var begin=new Date();
            var end=new Date();
            new Date(begin.setMonth((new Date().getMonth()-1)));
            var begintime= begin.format("yyyy-MM-dd");
            var endtime=end.format("yyyy-MM-dd");
            $("#polSubDateBegin").val(begintime);
            $("#polSubDateEnd").val(endtime);
        }

        // 日期加减年且格式转换
        function dateAddYear (dateString, yearCount) {
            var newstr = (dateString.substr(0, 4) - yearCount) + dateString.substr(4)
            return new Date(newstr.replace(/-/g, "/")).getTime();
        }

        function summaryHide() {
            $('#summary_div').hide()
            // 清空总量
            $("#countValidPolicy").text("0");
            $("#totalPremium").text("0");
            $("#countOfCancel").text("0");
            $("#totalPremiumOfCancel").text("0");
        }
        // 展示汇总
        function summaryShow() {
            // 清空
            summaryHide()
            var jsonDate = checkConditions()

            if (!jsonDate) {
                $.closeLoading();
                return false
            }
            jsonDate.pageIndex =-1;
            $.openLoading();
            $.ajax({
                url : "<%=path%>/fuelGasPolicyList/queryFuelGasPolicyAll",
                type : 'POST',
                async : true,
                dataType:'json',
                data: jsonDate,
                success:function(data){
                    $.closeLoading();
                    $("#countValidPolicy").text(data.countValidPolicy);//有效保单笔数
                    $("#totalPremium").text(data.totalPremium);//设置保费合计
                    $("#countOfCancel").text(data.countOfCancel);//注销保单笔数
                    $("#totalPremiumOfCancel").text(data.totalPremiumOfCancel);//设置注销保费合计
                    $('#summary_div').show()
                }
            });
        }
    </script>

</head>
<body>
<form method="POST" name="form2">
    <input type="hidden" name="polNo" id="downLoadPolNoStr">
</form>
<div class="current">
    <table class="current_table_1">
        <tbody>
        <tr class="f2">
            <td><img src="./images/current_1.jpg"></td>
            <td class="current_table_1_td">
                <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
                <span style=" color:#136bab; ">统计分析
	                  	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>燃气险保险查询
	                  </span>
            </td>
            <td><img src="./images/current_3.jpg"></td>
        </tr>
        </tbody>
    </table>
</div>

<!--查询条件及结果表单 -->
<table border="1" class="table_02" style="height:150px">
    <tr height="50px">
        <td colspan="2" align="center">
            <form method="post" id="downloadlifePolicyFileForm">
                <table border="0" style="margin: 12px auto;">
                    <tr>
                        <td style="padding-left:40px; border: 0;text-align: right" nowrap="nowrap">机构：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <select class="search_select_1" name="privilegeBranch" id="privilegeBranch" onchange="clearBranchRelaField()" style="width: 206px"></select>
                        </td>
                        <td style="padding-left:40px;border: 0;text-align: right" nowrap="nowrap">出单机构：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px"><input id="dptCode" name="dptCde" type="text" readonly="readonly" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5" id="searchDeptBtn" value="请选择" onClick="openDeptDiv(1,this)"/></td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">产品：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <select id="tradProdType" name="tradProdType" class="search_select_1">
                                <option value="">---请选择---</option>
                                <c:forEach items="${prodTypeList}" var="pt">
                                    <option value="${pt.code }" title="${pt.codeName }">${pt.codeName }</option>
                                </c:forEach>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0;text-align: right" nowrap="nowrap">合作伙伴：</td>
                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="partnerNo" id="partnerNo" readonly="readonly" onselect="" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchPartnerBtn" value="请选择" onClick="openChannelInfoDiv(1,this)"/></td>
                        <td style="border: 0;text-align: right" nowrap="nowrap">合作伙伴子机构：</td>
                        <td style="border: 0 ;text-align: left; padding-right: 70px"><input name="partnerSubCode" id="subPartnerNo" readonly="readonly" style=" background-color: #ccc;" class="input_text">&nbsp;&nbsp;<input type="button"  class="input_button_5"  id="searchSubPartnerBtn" value="请选择" onClick="openSubChannelTreeDiv()"/></td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">保单号：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input name="polno" id="polno" class="input_text" style="width:130px;" size="25"/>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">保单提交日期：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input id="polSubDateBegin" name="polSubDateBegin" readonly="readonly" onclick="showCalendar('polSubDateBegin','y-mm-dd');"  class="input_time"/>
                        </td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input id="polSubDateEnd" name="polSubDateEnd" readonly="readonly" onclick="showCalendar('polSubDateEnd','y-mm-dd');"  class="input_time"/>
                        </td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">订单号：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input name="orderId" id="orderId" class="input_text" style="width:130px;" size="25"/>
                        </td>
                    </tr>
                    <tr>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">保单生效日期：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input id="polBeginDateBegin" name="polBeginDateBegin" readonly="readonly" onclick="showCalendar('polBeginDateBegin','y-mm-dd');"  class="input_time"/>
                        </td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">至：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input id="polBeginDateEnd" name="polBeginDateEnd" readonly="readonly" onclick="showCalendar('polBeginDateEnd','y-mm-dd');"  class="input_time"/>
                        </td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">保单状态：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <select class="search_select_1" name="stateId" id="polStatus">
                                <option value="">---请选择---</option>
                                <!-- 								   		<option value="0">试算</option> -->
                                <!-- 								   		<option value="1">核保通过</option> -->
                                <option value="2">承保</option>
                                <option value="3">已注销</option>
                            </select>
                        </td>
                    </tr>



                    <tr>
                        <td style="padding-left:40px; border: 0;text-align: right" nowrap="nowrap">投保人姓名：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input name="tbrName" id="tbrName" class="input_text" style="width:130px;" size="25"/>
                        </td>
                        <td style="padding-left:40px;border: 0;text-align: right" nowrap="nowrap">投保人证件号码：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input name="tbrId" id="tbrId" class="input_text" style="width:130px;" size="25"/>
                        </td>
                        <td style="border: 0;text-align: right;" nowrap="nowrap">被保险人姓名：</td>
                        <td style="border: 0;text-align: left;padding-right: 70px">
                            <input name="bbrName" id="bbrName" class="input_text" style="width:130px;" size="25"/>
                        </td>
                    </tr>




                    <tr>
                        <td colspan="6" style="border: 0;padding-top: 5px;padding-right: 70px">
                            <input type="button"  class="input_button_1"  value="查询"    onClick="queryNocarPolicy()"/>
                            <input type="button"  class="input_button_1"  value="重置"    onClick="resetCriteria()"/>
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
    <tr>
        <td valign="top">
            <div id="nocarPolicyDiv" style="width:98%;margin:5px" >
                <div align="left" style="margin:15px">
                    <input type="button"  class="input_button_2"  value="导出Excel" onClick="downloadlifePolicyFile()"/>&nbsp;
                    <!-- 汇总按钮 -->
                    <input style="float: right" type="button"  onclick="summaryShow()" id="summary_btn" class="input_button_2"  value="展示汇总"/>

                    <!-- 汇总点击按钮才展示 -->
                    <div align="right" id="summary_div" style="margin:15px;display:none;">
                        <span>有效保单笔数：</span><span id="countValidPolicy" style="color: red">0</span>笔&nbsp;&nbsp;
                        <span>含税保费合计：</span><span id="totalPremium" style="color: red">0</span>元&nbsp;&nbsp;
                        <span>注销保单笔数：</span><span id="countOfCancel" style="color: red">0</span>笔&nbsp;&nbsp;
                        <span>注销含税保费合计：</span><span id="totalPremiumOfCancel" style="color: red">0</span>元
                    </div>
                </div>
                <table class="table_02" id="nocarPolicyTable">
                    <thead>
                    <tr>
                        <th style="width:4%" nowrap="nowrap">选择</th>
                        <th style="width:12%" nowrap="nowrap">保单号</th>
                        <th style="width:6%" nowrap="nowrap">出单机构</th>
                        <th style="width:8%" nowrap="nowrap">合作伙伴</th>
                        <th style="width:6%" nowrap="nowrap">合作伙伴子机构</th>
                        <th style="width:8%" nowrap="nowrap">投保方案</th>
                        <th style="width:5%" nowrap="nowrap">投保人</th>
                        <th style="width:6%" nowrap="nowrap">用户号</th>
                        <th style="width:6%" nowrap="nowrap">录入人工号</th>
                        <th style="width:6%" nowrap="nowrap">录入人名称</th>
                        <th style="width:5%" nowrap="nowrap">含税保费</th>
                        <th style="width:9%" nowrap="nowrap">保单提交日期</th>
                        <th style="width:9%" nowrap="nowrap">起保日期</th>
                        <th style="width:9%" nowrap="nowrap">终保日期</th>
                        <th style="width:6%" nowrap="nowrap">状态</th>
                        <th style="width:7%" nowrap="nowrap">员工编号</th>
                        <th style="width:13%" nowrap="nowrap">订单号</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <div id="nocarPolicyPageDiv"  class="page"></div>
            </div>
        </td>
    </tr>
</table>

<!--选择出单机构 DIV 默认隐藏-->
<div id="deptDiv" style="display:none;width:80%;">
    <!--   		<input type="hidden" id="row_num" name="row_num" value="0"/> -->
    <div class="table_title_div">
        <table class="table_title" style='width:100%;height: 20px;'>
            <tr>
                <td width="10%"></td>
                <td width="80%" id="interfaceName"></td>
                <td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('deptDiv')"/></td>
            </tr>
        </table>
    </div>
    <table class="table_02" id="table" style="height:180px;" align="center">
        <tr>
            <td>
                <table class="search_table">
                    <tr height="30px">
                        <td colspan="3" style="text-align:center">
                            出单机构代码：<input name="txt3"  id="deptCode"  type="text" class="input_text" value="" >&nbsp;&nbsp;
                            出单机构名称：<input name="txt3" id="deptCname"  type="text" class="input_text" value="">
                            <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryCoreDept(1)"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table id="deptTable"  class="content_table_1">
                    <thead>
                    <tr class="f1">
                        <th style="width:5%">选择</th>
                        <th style="width:40%">出单机构代码</th>
                        <th style="width:55%">出单机构名称</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <div id="deptPageDIV"  class="page"></div>
            </td>
        </tr>
    </table>
    <div align="center" >
        <input type="button" id="saveRoleBtn" value="确定" onclick="chooseDept()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
        <input type="button" value="取消" onclick="closeCurrentDIV('deptDiv')" class="input_button_3"/>
    </div>
</div>

<!--选择 合作伙伴 div 默认隐藏-->
<div id="channelInfoDiv" style="display:none;width:80%;">
    <div class="table_title_div">
        <table class="table_title" style='width:100%;height: 20px;'>
            <tr>
                <td width="10%"></td>
                <td width="80%" id="interfaceName"></td>
                <td width="10%" align="right"><img src="./images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('channelInfoDiv')"/></td>
            </tr>
        </table>
    </div>
    <table class="table_02" id="table" style="height:180px;" align="center">
        <tr>
            <td>
                <table class="search_table">
                    <tr height="30px">
                        <td colspan="3" style="text-align:center">
                            合作伙伴代码：<input name="txt3"  id="channelCode"  type="text" class="input_text" value="" >&nbsp;&nbsp;
                            合作伙伴名称：<input name="txt3" id="channelName"  type="text" class="input_text" value="">&nbsp;&nbsp;
                            <input type="button"  class="input_button_1" id="searchBtn" value="查询" onClick="queryTradPartners(1)"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table id="channelInfoTable"  class="content_table_1">
                    <thead>
                    <tr class="f1">
                        <th style="width:5%">选择</th>
                        <th style="width:10%">合作伙伴代码</th>
                        <th style="width:20%">合作伙伴名称</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <div id="channelInfoPageDIV"  class="page"></div>
            </td>
        </tr>
    </table>
    <div align="center" >
        <input type="button" id="saveRoleBtn" value="确定" onclick="choosePartner()" class="input_button_3"/>&nbsp;&nbsp;&nbsp;
        <input type="button" value="取消" onclick="closeCurrentDIV('channelInfoDiv')" class="input_button_3"/>
    </div>
</div>

<%--subChannelTree(选择合作伙伴子机构层) --%>
<div id="subChannelTreeDiv" style="display: none;width:500px;margin-top: -50px" align="center">
    <div class="table_title_div">
        <table class="table_title" style='width:500px; height: 20px;'>
            <tr>
                <td width="10%"></td>
                <td width="80%" id="interfaceName"></td>
                <td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeChannelTreeDiv()"/></td>
            </tr>
        </table>
    </div>

    <div style="height: 300px;width:500px; overflow:auto">
        <ul id="subChannelTree" class="ztree"></ul>
    </div>

    <div style="text-align: center;padding: 5px">
        <input type="button" id="choseChannelBtn" value="确定" onclick="chooseSubPartner()" class="input_button_1"/>&nbsp;&nbsp;&nbsp;
        <input type="button" value="取消" onclick="closeCurrentDIV('subChannelTreeDiv')" class="input_button_1"/>
    </div>
</div>
<%-- 个单投保流程 --%>
<div id="policyDetailInfo" style="display: none;width: 65%;height:75%; padding-bottom: 10px;margin-top: -50px;overflow-y:auto;">
    <div class="table_title_div">
        <table class="table_title" style='width:100%;height: 20px;'>
            <tr>
                <td width="10%"></td>
                <td width="80%" id="interfaceName"></td>
                <td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('policyDetailInfo')"/></td>
            </tr>
        </table>
    </div>
    <div>
        <ul style="padding-top: 8px;">
            <li style="float: left;  width: 80% "><h5 class="sub-title">基本信息</h5></li>
            <li style="float: left;  width: 20%"><span id="singelIsEpolicyl" style="height: 30px;line-height: 30px; text-indent: 10px; "><a href="" id="singelEpolicylUrl" target="_blank" style="color: blue;  text-decoration:underline;" >电子保单下载 </a></span></li>
        </ul>
    </div>
    <table class="table_02" align="center" style="width: 95%;">
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">保单号：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_polno"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">投保方案：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_planDscp"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">起保日期：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_beginDate"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">终保日期：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_endDate"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">含税保费：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_premium"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">增值税额：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_premVat"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">不含税保费：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_premNotax"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">总保额：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_amount"></span></td>
        </tr>
    </table>
    <h5 class="sub-title">投/被保人信息</h5>
    <table class="table_02" align="center" style="width: 95%;">
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">投保人姓名：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_realName"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">投保人证件类型：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_certiType"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">投保人邮箱：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><input id = "singel_email" style="width:135px"/> <input type="button" value="邮件重发" id="reSendEmail" onclick='reSendEmail()'class="input_button_2"></td>
            <td style="text-align:right;border-right: 0px;" width="15%">投保人证件号码：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_certiCode"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">投保人电话：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><input style="width:135px" id = "singel_telephone"  /> <input type="button"  value="短信重发" id="reSendSMS" onclick='reSendSMS()' class="input_button_2"></td>
            <td style="text-align:right;border-right: 0px;" width="15%"></td>
            <td style="text-align:left;padding-left:6px;" width="35%"></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">被保人姓名：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_bbr_realName"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">被保人证件类型：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_certiType"></span></td>
        </tr>
        <tr>
            <td style="text-align:right;border-right: 0px;" width="15%">被保人电话：</td>
            <td style="text-align:left;padding-left:6px;border-right: 0px;" width="35%"><span id = "singel_bbr_telephone"></span></td>
            <td style="text-align:right;border-right: 0px;" width="15%">被保人证件号码：</td>
            <td style="text-align:left;padding-left:6px;" width="35%"><span id = "singel_bbr_certiCode"></span></td>
        </tr>
    </table>
</div>
</body>
</html>